home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / archiver / unix / zip19p1.zoo / makefile < prev    next >
Makefile  |  1992-08-26  |  7KB  |  256 lines

  1. # Makefile for Zip, ZipNote, ZipCloak and ZipSplit
  2.  
  3. # what you can make ...
  4. all:
  5.     @echo ''
  6.     @echo 'Make what?  You must say what system to make Zip for--e.g.'
  7.     @echo '"make bsd".  Choices: 3b1, aix, att6300, aux, bsd, bsdold,'
  8.     @echo 'convex, cray, cray3, dec_osf1, dnix, hpux, isc, linux,'
  9.     @echo 'minix, next, next10, scodos, sun, sun_gcc, sysv, sysv_386,'
  10.     @echo 'sysv_old, ultrix, xenix, xos, zilog.'
  11.     @echo 'See the files install.doc and zip.doc for more information.'
  12.     @echo ''
  13.  
  14. CRYPTO =
  15. CLOAK =
  16. CRFLAG =
  17. MAKE = make
  18. #  **********************************************************************
  19. #  *** For encryption version, remove the # at the front of next line ***
  20. # MAKE = make CRYPTO="crypt.o" CLOAK="zipcloak" CRFLAG="-DCRYPT"
  21.  
  22. # (to use the Gnu compiler, change cc to gcc in CC and BIND)
  23. CC = cc
  24. BIND = cc
  25. E =
  26. CPP = /usr/lib/cpp -Dunix
  27.  
  28. # probably can change this to 'install' if you have it
  29. INSTALL = cp
  30.  
  31. # target directories - where to install executables and man pages to
  32. BINDIR = /usr/local/bin
  33. MANDIR = /usr/man/manl
  34.  
  35. # flags
  36. #   CFLAGS    flags for C compile
  37. #   LFLAGS1   flags after output file spec, before obj file list
  38. #   LFLAGS2   flags after obj file list (libraries, etc)
  39. CFLAGS = -O
  40. LFLAGS1 =
  41. LFLAGS2 = -s
  42.  
  43. # object file lists
  44. OBJZ = zip.o zipfile.o zipup.o fileio.o util.o globals.o $(CRYPTO)
  45.  
  46. OBJI = deflate.o trees.o bits.o
  47. OBJA =
  48. OBJU = zipfile_.o zipup_.o fileio_.o util_.o globals.o
  49. OBJN = zipnote.o  $(OBJU)
  50. OBJC = zipcloak.o $(OBJU) crypt_.o
  51. OBJS = zipsplit.o $(OBJU)
  52.  
  53. # suffix rules
  54. .SUFFIXES:
  55. .SUFFIXES: _.o .o .c .doc .1
  56. .c_.o:
  57.     rm -f $*_.c; ln $< $*_.c
  58.     $(CC) $(CFLAGS) -DUTIL $(CRFLAG) -c $*_.c
  59.     rm -f $*_.c
  60. .c.o:
  61.     $(CC) $(CFLAGS) $(CRFLAG) -c $<
  62.  
  63. .1.doc:
  64.     nroff -man $< | col -b | uniq > $@
  65.  
  66. # rules for zip, zipnote, zipcloak, zipsplit, and zip.doc.
  67. $(OBJZ): zip.h ziperr.h tailor.h
  68. $(OBJI): zip.h ziperr.h tailor.h
  69. $(OBJN): zip.h ziperr.h tailor.h
  70. $(OBJS): zip.h ziperr.h tailor.h
  71. $(OBJC): zip.h ziperr.h tailor.h
  72.  
  73. match.o: match.s
  74.     $(CPP) match.s > _match.s
  75.     $(CC) -c _match.s
  76.     mv _match.o match.o
  77.     rm -f _match.s
  78.  
  79. ZIPS = zip$E zipnote$E zipsplit$E $(CLOAK)$E
  80.  
  81. zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h
  82. zips: $(ZIPS)
  83. zipsman: zip zipnote zipsplit $(CLOAK) zip.doc
  84.  
  85. zip$E: $(OBJZ) $(OBJI) $(OBJA)
  86.     $(BIND) -o zip$E $(LFLAGS1) $(OBJZ) $(OBJI) $(OBJA) $(LFLAGS2)
  87. zipnote$E: $(OBJN)
  88.     $(BIND) -o zipnote$E $(LFLAGS1) $(OBJN) $(LFLAGS2)
  89. zipcloak$E: $(OBJC)
  90.     $(BIND) -o zipcloak$E $(LFLAGS1) $(OBJC) $(LFLAGS2)
  91. zipsplit$E: $(OBJS)
  92.     $(BIND) -o zipsplit$E $(LFLAGS1) $(OBJS) $(LFLAGS2)
  93.  
  94. # install
  95. install:    $(ZIPS)
  96.     $(INSTALL) $(ZIPS) $(BINDIR)
  97.     $(INSTALL) zip.1 $(MANDIR)
  98.  
  99.  
  100. # These symbols, when #defined using -D have these effects on compilation:
  101. # ZMEM        - includes C language versions of memset(), memcpy(), and
  102. #          memcmp() (util.c).
  103. # DIRENT    - use <sys/dirent.h> and getdents() instead of <sys/dir.h>
  104. #          and opendir(), etc. (fileio.c).
  105. # NODIR        - used for 3B1, which has neither getdents() nor opendir().
  106. # NDIR        - use "ndir.h" instead of <sys/dir.h> (fileio.c).
  107. # UTIL        - select routines for utilities (note, cloak, and split).
  108. # PROTO        - enable function prototypes.
  109. # RMDIR        - remove directories using a system("rmdir ...") call.
  110. # CONVEX    - for Convex make target.
  111. # AIX        - for AIX make target.
  112. # CRYPT     - include the encryption code.
  113. # LINUX        - for linux make target.
  114.  
  115. # BSD 4.3 (also Unisys 7000--AT&T System V with heavy BSD 4.2)
  116. bsd:
  117.     $(MAKE) zips CFLAGS="-O"
  118.  
  119. # BSD, but missing memset(), memcmp().
  120. bsdold:
  121.     $(MAKE) zips CFLAGS="-O -DZMEM"
  122.  
  123. # AT&T System V, Rel 3.  Also SCO Unix, OpenDeskTop, ETA-10P*, SGI.
  124. sysv_old:
  125.     $(MAKE) zips CFLAGS="-O -DDIRENT"
  126.  
  127. # AT&T System V, Rel 4. Also any system with readdir() and termio.
  128. sysv:
  129.     $(MAKE) zips CFLAGS="-O -DSYSV -DTERMIO"
  130.  
  131. # AT&T System V, Rel 4 for 386 (uses asm version):
  132. sysv_386:
  133.     $(MAKE) zips CFLAGS="-O -DSYSV -DTERMIO -DASM" OBJA=match.o
  134.  
  135. # SCO Xenix
  136. xenix:
  137.     $(MAKE) zips CFLAGS="-O -DSYSV -DTERMIO" LFLAGS2="-lx -s"
  138.  
  139. # DNIX 5.x: like System V but optimization is messed up.
  140. dnix:
  141.     $(MAKE) zips CFLAGS="-DDIRENT"
  142.  
  143. # Linux 0.96a with GCC 2.12, dies with <= 2.11c. builtin functions are
  144. # disabled because '#define const' removes const from normal functions
  145. # but not builtin ones. And keeping const causes problems on other systems.
  146. linux:
  147.     $(MAKE) zips CFLAGS="-O -fno-builtin -DSYSV -DTERMIO -DLINUX" \
  148.       CC=gcc BIND=gcc
  149.  
  150. # Sun OS 4.x: BSD, but use getdents(). If you have gcc, use 'make sun_gcc'
  151. # instead since the code produced is better.
  152. sun:
  153.     $(MAKE) zips CFLAGS="-O4 -DDIRENT"
  154.  
  155. # Sun OS 4.x with gcc (bug with -s linker flag). Use -O if your version
  156. # of gcc does not like -O2.
  157. sun_gcc:
  158.     $(MAKE) zips CFLAGS="-O2 -DDIRENT" CC=gcc BIND=gcc LFLAGS2=""
  159.     strip $(ZIPS)
  160.  
  161. # NeXT 1.0: BSD, but use shared library.
  162. next10:
  163.     $(MAKE) zips CFLAGS="-O" LFLAGS2="-s -lsys_s"
  164.  
  165. # NeXT 2.0: BSD, but use MH_OBJECT format for smaller executables.
  166. next:
  167.     $(MAKE) zips CFLAGS="-O" LFLAGS2="-s -object"
  168.  
  169. # HPUX: System V, but use <ndir.h> and opendir(), etc.
  170. hpux:
  171.     $(MAKE) zips CFLAGS="-O -DNDIR"
  172.  
  173. # Cray Unicos 5.1.10 & 6.0.11, Standard C compiler 2.0
  174. cray:
  175.     $(MAKE) zips CFLAGS="-O -DDIRENT" CC="scc"
  176.  
  177. # Cray Unicos 6.1, Standard C compiler 3.0 (all routines except trees.c
  178. # may be compiled with vector3; internal compiler bug in 3.0.2.3 and
  179. # earlier requires vector2 for trees.c)
  180. cray3:
  181.     $(MAKE) zips CFLAGS="-O -h vector2 -h scalar3 -DDIRENT" CC="scc"
  182.  
  183. # AT&T 3B1: System V, but missing a few things.
  184. 3b1:
  185.     $(MAKE) zips CFLAGS="-O -DNODIR -DRMDIR"
  186.  
  187. # AT&T 6300 PLUS (don't know yet how to allocate 64K bytes):
  188. att6300:
  189.     $(MAKE) zips LFLAGS1="-Ml" \
  190.     CFLAGS="-O -Ml -DNODIR -DRMDIR -DDYN_ALLOC -DMEDIUM_MEM -DWSIZE=16384"
  191.  
  192. # zilog zeus 3.21
  193. zilog:
  194.     $(MAKE) zips CFLAGS="-O -DZMEM -DNDIR -DRMDIR" CC="scc -i" BIND="scc"
  195.  
  196. # SCO 386 cross compile for MS-DOS
  197. # Note: zip.exe should be lzexe'd on DOS to reduce its size
  198. scodos:
  199.     $(MAKE) zips CFLAGS="-O -Mc -dos -DNO_ASM" LFLAGS1="-Mc -dos" \
  200.      LFLAGS2="-F 1000" E=".exe"
  201.  
  202. # A/UX:
  203. aux:
  204.     $(MAKE) zips CFLAGS="-O -DTERMIO"
  205.  
  206. # Convex C-120, C-210, OS 9.0, cc v. 4.0, no vectorization used.
  207. convex:
  208.     $(MAKE) zips CFLAGS="-O"
  209.  
  210. # AIX Version 3.1 for RISC System/6000 
  211. aix:
  212.     $(MAKE) zips CC="c89" BIND="c89" \
  213.        CFLAGS="-O -D_POSIX_SOURCE -D_ALL_SOURCE -D_BSD -DAIX"
  214.  
  215. # MINIX 1.5.10 with Bruce Evans 386 patches and gcc/GNU make
  216. minix:
  217.     $(MAKE) zips CFLAGS="-O -DDIRENT -DMINIX" CC=gcc BIND=gcc
  218.     chmem =262144 zip
  219.  
  220. # Interactive Systems Corporation System V/386, Rel 3.2--optimizer problems
  221. isc:
  222.     $(MAKE) zips CFLAGS="-DDIRENT"
  223.  
  224. # DYNIX (R) V3.0.18 (no memset() or memcmp(), rindex() instead of strrchr())
  225. dynix:
  226.     $(MAKE) zips CFLAGS="-O -DZMEM -Dstrrchr=rindex"
  227.  
  228. # Ultrix
  229. ultrix:
  230.     $(MAKE) zips CFLAGS="-O -Olimit 700"
  231.  
  232. # DEC OSF/1
  233. dec_osf1:
  234.     $(MAKE) zips CFLAGS="-O -Olimit 1000 -DOSF -D_BSD"
  235.  
  236. # xos: Olivetti LSX-3005..3045 with X/OS 2.3 or 2.4
  237. xos:
  238.     $(MAKE) zips CFLAGS="-O -DTERMIO"
  239.  
  240. # clean up after making stuff and installing it
  241. clean:
  242.     rm -f *.o
  243.     rm -f $(ZIPS)
  244.  
  245. # This one's for Mark:
  246. it:
  247.     $(MAKE) zipsman CFLAGS="-O -Wall -DPROTO"\
  248.     LFLAGS2="-s -object" VPATH="${HOME}/Unix/bin"
  249.  
  250. # and this one for Jean-loup:
  251. gcc_d:
  252.     $(MAKE) zip CFLAGS="-g -DDEBUG -DDIRENT" CC=gcc BIND=gcc LFLAGS2="-g"
  253.     mv zip zipd
  254.  
  255. # end of Makefile
  256.